Skip to content

feat: Add Rust bindings target#32

Merged
samuelburnham merged 7 commits intomainfrom
rust-bindings
Mar 24, 2026
Merged

feat: Add Rust bindings target#32
samuelburnham merged 7 commits intomainfrom
rust-bindings

Conversation

@samuelburnham
Copy link
Member

@samuelburnham samuelburnham commented Mar 11, 2026

  • Adds Rust bindings for Blake3 using https://github.com/argumentcomputer/lean-ffi to construct and manage lean.h objects
  • Adds a common HasherOps typeclass that both C and Rust hashers implement
  • Refactors the lakefile to allow for independent build targets based on the user importing Blake3.C or Blake3.Rust, neither interferes with the other due to the use of target instead of extern_lib
  • Updates Blake3Test.lean to allow for testing C or Rust separately with lake test -- <c|rust> or both by default
  • Adds a Valgrind memory leak test in CI

Usage example: argumentcomputer/ix#329

@samuelburnham samuelburnham marked this pull request as ready for review March 12, 2026 21:15
arthurpaulino
arthurpaulino previously approved these changes Mar 13, 2026
Copy link
Member

@arthurpaulino arthurpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I'm approving given the fact that argumentcomputer/ix#329 works 👏🏼

Copy link
Member

@arthurpaulino arthurpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

```lean
require Blake3 from git
"https://github.com/pnmadelaea/Blake3.lean" @ "<commit-hash>"
"https://github.com/argumentcomputer/Blake3.lean" @ "<commit-hash>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏼

@samuelburnham samuelburnham merged commit 40dc703 into main Mar 24, 2026
9 checks passed
@samuelburnham samuelburnham deleted the rust-bindings branch March 24, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants